<?php

class LiveController extends Controller
{
	public function actionSf()
	{
		Yii::app()->theme='resultados';	
		
		Yii::app()->theme='resultados';	
		$connection = Yii::app()->db;	
		$command = $connection->createCommand("SELECT grsm.surf_marcador_id,grsm.grid_programa_entidad_id,gre.grid_grupo,grsm.color,
        grsm.puntaje,grsm.posicion,grsm.estado,grp.grid_programa_descripcion,gre.grid_grupo,gpa.pais_nombre
        FROM grid_r_surf_marcador grsm
        inner join grid_r_entidad gre on grsm.grid_programa_entidad_id = gre.grid_entidad_id 
        inner join grid_r_programa_entidad grpe on grpe.grid_entidad_id = gre.grid_entidad_id 
        inner join grid_r_programa grp on grp.grid_programa_id = grpe.grid_programa_id
        inner join grid_pais gpa on gpa.pais_id = gre.grid_pais_id
        where gre.grid_deporte_actividad_id =3 and estado='INICIADO'
        
        order by  grid_programa_descripcion,puntaje
      ");

		$dataReader = $command->query();
		
		$rows=$dataReader->readAll();
		
		$this->render('surf',array('marcadores'=>$rows));
	}
	
	
	public function actionDeporte()
	{
		$this->render('deporte');
	}

	public function actionIndex()
	{
		$this->render('index');
	}

	// Uncomment the following methods and override them if needed
	/*
	public function filters()
	{
		// return the filter configuration for this controller, e.g.:
		return array(
			'inlineFilterName',
			array(
				'class'=>'path.to.FilterClass',
				'propertyName'=>'propertyValue',
			),
		);
	}

	public function actions()
	{
		// return external action classes, e.g.:
		return array(
			'action1'=>'path.to.ActionClass',
			'action2'=>array(
				'class'=>'path.to.AnotherActionClass',
				'propertyName'=>'propertyValue',
			),
		);
	}
	*/
}